#include<bits/stdc++.h>
using namespace std;
const int N=35;

int n;
int arr[N][N];
int res;

int main()
{
    scanf("%d",&n);
    int w;
    for(int i=1;i<=n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            scanf("%d",&w);
            arr[i][j]=arr[j][i]=w;
        }
    }
    res=arr[1][2];
    for(int i=3;i<=n;i++)
    {
        double minw;
        memset(&minw,0x5f,sizeof(minw));
        for(int n1=1;n1<i;n1++){
            for(int n2=n1+1;n2<i;n2++){
                minw =min(minw,(arr[n1][i]+arr[i][n2]-arr[n1][n2])/2.0);
            }
        }
        //cout<<i<<" "<<minw<<endl;
        res+=(int)minw;
    }
    printf("%d",res);
    return 0;
}